package com.temp.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.temp.dto.SearchPaymentDTO;
import com.temp.entity.PaymentOrder;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface PaymentOrderMapper extends BaseMapper<PaymentOrder> {

    List<PaymentOrder> findAllPaymentViews(SearchPaymentDTO paymentDTO);

    Integer countAllPaymentViews(SearchPaymentDTO paymentDTO);

    @Select("select po.* from payment_order_view po where po.order_id = #{orderId} and po.user_id = #{userId}")
    PaymentOrder findPaymentViewByOrderId(@Param("orderId") String orderId, @Param("userId") Long userId);
}
